const fileToBase64 = (file)=>{
    const fileRender = new FileReader()
    fileRender.readAsDataURL(file)
    return new Promise((resolve,reject)=>{
        fileRender.onloadend = (res) => {
            if(res?.target?.result){
                resolve(res.target.result)
            }else{
                reject(new Error('imgPath error'))
            }
       }
    }) 
     
}
const fileToUrl = (file)=>{
    return URL.createObjectURL(file)
}
export {
    fileToBase64,
    fileToUrl
}